﻿using System;
using System.Windows;
using EventLogAnalyzer.ViewModel;

namespace EventLogAnalyzer.View
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void browseFile_Click(object sender, RoutedEventArgs e)
        {
            var dlg = new Microsoft.Win32.OpenFileDialog
                      {
                          DefaultExt = ".xml",
                          Filter = "XML Event Log files (.xml)|*.xml"
                      };

            Nullable<bool> result = dlg.ShowDialog();

            if (result == true)
            {
                ((MainWindowViewModel)DataContext).EventLogsFolderPath = dlg.FileName;
            }
        }
    }
}
